<script setup lang="ts">
const obj = { a: 1, b: '2' }
obj
const obj2 = { c: 3, d: true }
obj2
function getVal<O extends object, K extends keyof O>(obj: O, key: K) {
  return obj[key]
}
console.log(getVal(obj, 'a'))
console.log(getVal(obj, 'b'))
console.log(getVal(obj2, 'd'))
</script>

<template>
  <div class="playground-page">
    <h1>playground综合练习</h1>
  </div>
</template>

<style scoped></style>
